package com.corpdata.app.customer.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import com.corpdata.app.customer.entity.SellTeamStaff;
import com.corpdata.core.base.BaseMapper;

/**
 *  持久层接口
 * @author wu
 * @email 64088839@qq.com
 * @date 2018-07-13 17:22:49
 * 
 */
public interface SellTeamStaffMapper extends BaseMapper<SellTeamStaff>{

	@Insert("<script>insert into sell_team_staff " + 
			"		( " + 
			"			id,  " + 
			"			Fk_customer_info,  " + 
			"			Fk_user " + 
			"		) " + 
			"		values " + 
			"<foreach collection=\"array\" item=\"t\" separator=\",\">"+
			"		( " + 
			"			#{t.id},  " + 
			"			#{t.fkCustomerInfo},  " + 
			"			#{t.fkUser} " + 
			"		)</foreach></script>")
	int insertList(SellTeamStaff[] sts);

	@Delete("delete from sell_team_staff where Fk_customer_info=#{fkCustomerInfo} and Fk_user=#{fkUser}")
	int deleteByuidAndCid(SellTeamStaff sellTeamStaff);

	@Delete("delete from sell_team_staff where Fk_customer_info=#{cid}")
	int deleteAllByCid(String cid);
}
